<!--
* @fileName center-info.vue
* @author caoke
* @date 2022/10/18 14:58:54
* @version V1.0.0
* @description 
!-->
<template>
  <div class="container">
    <el-menu :default-active="activeIndex" mode="horizontal" background-color="#ffffff" text-color="black" active-text-color="#F76F40">
      <el-menu-item index="1">个人资料</el-menu-item>
      <el-menu-item index="2">关联企业</el-menu-item>
      <el-menu-item index="3">配送地址</el-menu-item>
      <el-menu-item index="4">修改密码</el-menu-item>
      <el-menu-item index="4">电子发票申请</el-menu-item>
      <el-menu-item index="4">已开发票查询</el-menu-item>
    </el-menu>
    <el-form :model="form" :inline="true" label-width="120px" :rules="rules" ref="ruleForm">
      <content-card title="个人信息" type="line" style="margin-top:10px">
        <div class="form-container">
          <div class="item">
            <el-form-item label="姓名" prop="name">
              <el-input v-model="form.name"></el-input>
            </el-form-item>
            <el-form-item label="账号">
              <el-input v-model="form.userid"></el-input>
            </el-form-item>
          </div>
          <div class="item">
            <el-form-item label="手机号">
              <el-input v-model="form.phone"></el-input>
            </el-form-item>
            <el-form-item label="邮箱">
              <el-input v-model="form.email"></el-input>
            </el-form-item>
          </div>
          <div class="item">
            <el-form-item label="证件类型">
              <el-input v-model="form.idType"></el-input>
            </el-form-item>
            <el-form-item label="证件号码" prop="id">
              <el-input v-model="form.id"></el-input>
            </el-form-item>
          </div>
          <div class="item">
            <el-form-item label="地址">
              <el-input v-model="form.address" style="width:580px"></el-input>
            </el-form-item>
          </div>
        </div>

      </content-card>
      <content-card title="身份认证" type="line">
        <!-- <div class="form-container">
          <div class="item">

          </div>
        </div> -->
        <el-form-item label="证件照片">
          <div class="idcard-box">
            <div class="card-container">
              <div class="icon-container">
                <i class="el-icon-plus"></i>
              </div>
              <span>请上传身份证正面</span>
              <span>（头像面）</span>
            </div>
            <div class="card-container">
              <div class="icon-container">
                <i class="el-icon-plus"></i>
              </div>
              <span>请上传身份证反面</span>
              <span>（国徽面）</span>
            </div>
          </div>

        </el-form-item>
      </content-card>
      <el-form-item>
        <div class="btn-container">
          <el-button type="danger" @click="submitForm('ruleForm')" style="width:100px">保存</el-button>
        </div>

      </el-form-item>
    </el-form>

  </div>
</template>

<script>
import contentCard from "../../../components/base/content-card/content-card.vue";
export default {
  components: { contentCard },
  name: "",
  data() {
    return {
      activeIndex: "1",
      form: {},
      rules: {
        name: [
          { required: true, message: "请输入姓名名称", trigger: "blur" },
          { min: 2, max: 5, message: "长度在 2 到 5 个字符", trigger: "blur" },
        ],
        id: [{ required: true, message: "请输入证件号码", trigger: "change" }],
      },
    };
  },
  created() {},
  methods: {
    submitForm(formName) {
      this.$refs[formName].validate((valid) => {
        if (valid) {
          alert("submit!");
        } else {
          console.log("error submit!!");
          return false;
        }
      });
    },
  },
};
</script>
<style lang='scss' scoped>
.idcard-box {
  display: flex;
  width: 800px;
  justify-content: space-around;
}
.form-container {
  .item {
    display: flex;
  }
}
.btn-container {
  display: flex;
  flex-direction: column;
  width: 1000px;
  align-items: center;
  justify-content: center;
  margin-top: 20px;
}

.card-container {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: 360px;
  height: 220px;
  border-radius: 16px;
  border: 1px dashed #dcebe6;
  .icon-container {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background-color: $theme;
    color: #ffffff;
    font-size: 40px;
  }
}
</style>